.panel.mr-state-widget.panel-default
  - if @merge_request.source_project.gitlab_ci? && @commits.any?
    .panel-heading
      = render "projects/merge_requests/show/mr_ci"
  .panel-body
    - if @merge_request.open?
      - if @merge_request.source_branch_exists? && @merge_request.target_branch_exists?
        = render "projects/merge_requests/show/mr_accept"
      - else
        = render "projects/merge_requests/show/no_accept"

    - if @merge_request.closed?
      %h4
        Closed by #{link_to_member(@project, @merge_request.closed_event.author, avatar: false)}
        #{time_ago_with_tooltip(@merge_request.closed_event.created_at)}
      %p Changes was not merged into target branch

    - if @merge_request.merged?
      %h4
        Merged by #{link_to_member(@project, @merge_request.merge_event.author, avatar: false)}
        #{time_ago_with_tooltip(@merge_request.merge_event.created_at)}
      = render "projects/merge_requests/show/remove_source_branch"

    - if !@closes_issues.empty? && @merge_request.open?
      .alert.alert-info.alert-info
        %span
          %i.icon-ok
          Accepting this merge request will close #{@closes_issues.size == 1 ? 'issue' : 'issues'}
          = succeed '.' do
            != gfm(@closes_issues.map { |i| "##{i.iid}" }.to_sentence)

    - unless @commits.any?
      %h4 Nothing to merge
      %p
        Nothing to merge from
        %span.label-branch #{@merge_request.source_branch}
        to
        %span.label-branch #{@merge_request.target_branch}
        %br
        Try to use different branches or push new code.
